package com.cjm.one.custom.client;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.cjm.one.common.constant.ServerConstants;
import com.cjm.one.common.result.Result;
import com.cjm.one.model.custom.entity.CustomAddress;
import io.swagger.v3.oas.annotations.Operation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

@FeignClient(value = ServerConstants.SERVER_ONE_CUSTOM)
public interface CustomerAddressClient {
    @GetMapping("/app/customer/address/list")
    @Operation(summary = "地址列表")
    Result<Page<CustomAddress>> list(@RequestParam(name = "current",defaultValue = "1") Integer current ,
                                            @RequestParam(name = "size",defaultValue = "10") Integer size);

    @PostMapping("/app/customer/address/add")
    @Operation(summary = "添加地址")
    Result<Boolean> add(@RequestBody CustomAddress customAddress);

    @DeleteMapping("/app/customer/address/delete/{id}")
    @Operation(summary = "删除地址")
    Result<Boolean> delete(@PathVariable Long id);

    @PostMapping("/app/customer/address/update")
    @Operation(summary = "更新地址")
    Result<Boolean> update(@RequestBody CustomAddress customAddress);
    @GetMapping("/app/customer/address/info/{id}")
    @Operation(summary = "获取地址")
    Result<CustomAddress> getAddressInfo(@PathVariable Long id);

    @GetMapping("/app/customer/address/info/default")
    @Operation(summary = "获取地址详情")
    Result<CustomAddress> getAddressDefaultInfo();
}
